package com.glsc.ngateway.common.base.domainmapper;

import com.glsc.ngateway.common.api.platform.dto.other.FortressAccountImportDto;
import com.glsc.ngateway.common.base.domain.mysql.gateway.other.Fortress;
import com.glsc.ngateway.common.api.platform.dto.other.FortressMachineImportDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @Author: xuchang
 * @Desc: domin到dto转换
 */

/**
 * @Mapper自动生成接口实现类，完成domin与dto转换，componentModel=spring：规定实现类的组件类型，自动在实现类上加@Components注解，可以通过@Autowired引入实现类
 */
@Mapper(componentModel = "spring")
public interface FortressMachineMapper {

    FortressMachineMapper INSTANCE = Mappers.getMapper(FortressMachineMapper.class);

//    @Mapping(target = "editConfigDto", ignore = true)
//    @Mapping(target = "value", ignore = true)
//    FlowConfigDto do2Dto(FlowConfig domain);
//
//    List<FlowConfigDto> do2Dto(List<FlowConfig> domain);

//    @Mapping(target = "insertTime", ignore = true)
//    @Mapping(target = "updateTime", ignore = true)
//    @Mapping(target = "deleted", ignore = true)
//    @Mapping(target = "value", ignore = true)
//    FlowConfig dto2Do(FlowConfigDto dto);

    @Mapping(target = "id", ignore = true)
    @Mapping(target = "machine", ignore = true)
    @Mapping(target = "group", ignore = true)
    @Mapping(target = "auth", ignore = true)
    @Mapping(target = "protocol", ignore = true)
    @Mapping(target = "template", ignore = true)
    @Mapping(target = "from", ignore = true)
    @Mapping(target = "departmentOne", ignore = true)
    @Mapping(target = "departmentOneId", ignore = true)
    @Mapping(target = "departmentTwo", ignore = true)
    @Mapping(target = "departmentTwoId", ignore = true)
    @Mapping(target = "systemCode", ignore = true)
    @Mapping(target = "systemName", ignore = true)
    @Mapping(target = "notOa", ignore = true)
    @Mapping(target = "createTime", ignore = true)
    Fortress dto2Do(FortressAccountImportDto dto);

    List<Fortress> dto2Do(List<FortressAccountImportDto> dto);
}
